<html>
<head>
<link href="../style/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p class="heading">
Sound Module (last update 01/11/00)
</p>
<p class="subheading">
Description:
</p>
<p>
This module adds sound capabilities to gamelib. It is currently the least developed of all the modules
in gamelib, and as such it will only work with Explorer 5+ on Mac and PC platforms. On other browsers
it will not cause errors, but it will not make any sound either! Mozilla support will be added as soon
as possible.
</p>
<p class="subheading">
To use:
</p>
<p>
The code can be linked in to your script by adding this line to the &lt;HEAD&gt; section of your document:
</p>
<p class="jcode">
&lt;script language="Javascript" src="gamelib_sound.js"&gt;&lt;/script&gt;
</p>
<p>
For each sound you wish to trigger, you must create a new sound object as follows:
</p>
<p class="jcode">
mysound=new Sd_add_sound("sound/canyon.midi");
</p>
<p class="subheading">
List of methods for Sound module
</p>
<p>
<a href="#play">play</a><br>
<a href="#stop">stop</a><br>
<a href="#setBalance">setBalance</a><br>
<a href="#setLoop">setLoop</a><br>
<a href="#setVolume">setVolume</a><br>
</p>

<p class="subheading">
Descriptions of methods
</p>

<table>
<tr>
<th>Method</th><th NOWRAP>Parameters</th><th>Description</th>
</tr>

<tr>
<a name="play">
<td>play</td><td>(none)</td><td>Start the sound object playing. If the object is already playing, it will rewind, and restart</td>
</tr>

<tr>
<a name="stop">
<td>stop</td><td>(none)</td><td>Stop the sound object from playing</td>
</tr>

<tr>
<a name="setBalance">
<td>setBalance</td><td>Numeric</td><td>Sets the stereo balance for the sound. This ranges from -10000 for extreme left to 10000 for extreme right.</td>
</tr>

<tr>
<a name="setLoop">
<td>setBalance</td>
<td>Numeric</td>
<td>Sets the number of times the sound should loop once it has started playing. EG, 1 means play through just once.</td>
</tr>

<tr>
<a name="setVolume">
<td>setVolume</td><td>Numeric</td><td>Sets the volume for the sound. This ranges from 0 for silent to 100 for maximum. Be aware that this is not a linear scale. On my machine I can't hear any sound that's been set below 60. So I'm guessing that's the safe lower end value...</td>
</tr>

</table>

</body>
</html>